﻿<UserControl x:Class="ClassMetadataBrowser.UI.MetadataBrowser"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:local="clr-namespace:ClassMetadataBrowser.UI" Loaded="UserControlLoaded" Unloaded="UserControlUnloaded" x:Name="myuc" >

	<UserControl.CommandBindings>
		<CommandBinding Command="local:CustomCommands.ExitCommand" Executed="CommandExit" CanExecute="CommandExitCanExecute"/>
		<CommandBinding Command="local:CustomCommands.EnterCommand" Executed="CommandSelected" CanExecute="CommandSelectedCanExecute"/>
	</UserControl.CommandBindings>

	<UserControl.Resources>
		<local:ObjectIconConverter x:Key="IconConverter"/>
	</UserControl.Resources>

	<Grid>

		<Grid.RowDefinitions>
			<RowDefinition Height="*"/>
			<RowDefinition Height="30"/>
			<RowDefinition Height="30"/>
			<RowDefinition Height="25"/>
		</Grid.RowDefinitions>

		<TextBox IsEnabled="False" Grid.Row="1" Name="_txtCriteria" Margin="5" TextChanged="TxtCriteriaTextChanged"  PreviewKeyDown="TxtCriteriaKeyDown" />

		<ListView IsEnabled="False" Grid.Row="0" Margin="5" Name="_listView" SelectionMode="Single" MouseDoubleClick="ListViewMouseDoubleClick">
			<ListView.View>
				<GridView>
					<local:FixedWidthColumn Header="Icon" FixedWidth="50">
						<local:FixedWidthColumn.CellTemplate>
							<DataTemplate>
								<Image Width="16" Height="16" Margin="5"
									Source="{Binding Path=., Converter={StaticResource IconConverter}}"/>
							</DataTemplate>
						</local:FixedWidthColumn.CellTemplate>
					</local:FixedWidthColumn>
					<GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}" Width="400" />
					<GridViewColumn Header="Project" DisplayMemberBinding="{Binding ProjectName}" Width="160"/>
				</GridView>
			</ListView.View>
		</ListView>

		<StatusBar Grid.Row="3" BorderThickness="0,1,0,0" BorderBrush="LightBlue">
			<StackPanel Orientation="Horizontal" Name="_panelLoaded" Visibility="Collapsed">
				<TextBlock>
					Ready.
				</TextBlock>
				<Separator Name="_splitor" />
				<TextBlock Margin="5,0,0,0" Name="_itemsLoaded">

				</TextBlock>
				<Separator/>
				<TextBlock Name="_itemsMatches">

				</TextBlock>
			</StackPanel>
			<StackPanel Orientation="Horizontal" Name="_panelLoading" Visibility="Visible">
				<ProgressBar Width="100"  IsIndeterminate="True" />
				<Separator></Separator>
				<TextBlock Margin="5,0,0,0">
					Loading. It can take some time depending on the size of your solution.
				</TextBlock>
			</StackPanel>
		</StatusBar>
		
	</Grid>
</UserControl>
